home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Diversos / cocoon.swf / scripts / frame_18 / PlaceObject2_207_104 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2006-06-13  |  1.3 KB  |  54 lines

  1. onClipEvent(enterFrame){
  2.    if(_root.gamestopped != true)
  3.    {
  4.       _root.albero._rotation += step * (_root.bendrate / 100);
  5.       limit = (5 + _root.bendrate / 10) / _root.bendrate * _root.bendrate;
  6.       if((_root.albero._rotation > limit || _root.albero._rotation < limit * -1) && changed == false)
  7.       {
  8.          step *= -1;
  9.          changed = true;
  10.       }
  11.       else
  12.       {
  13.          changed = false;
  14.       }
  15.       if(_root.bendrate == 0 && _rotation != 0)
  16.       {
  17.          if(_rotation > 0)
  18.          {
  19.             _rotation = _rotation - 1;
  20.          }
  21.          if(_rotation < 0)
  22.          {
  23.             _rotation = _rotation + 1;
  24.          }
  25.       }
  26.       if(_root.bendrate == 0 && _rotation == 0)
  27.       {
  28.          step = 5;
  29.       }
  30.       if(_root.timeleft < 0)
  31.       {
  32.          _root.gotoAndPlay("gameover");
  33.          _root.gamestopped = true;
  34.       }
  35.    }
  36.    faccia = distinguiFaccia(_root.bendrate);
  37.    if(faccia != oldfaccia)
  38.    {
  39.       _root.albero.scimmia.gotoAndStop(faccia);
  40.       oldfaccia = faccia;
  41.    }
  42.    if(faccia == 3 || faccia == 4)
  43.    {
  44.       if(_root.nutController.acceso == false)
  45.       {
  46.          _root.nutController.acceso = true;
  47.       }
  48.    }
  49.    if(faccia == 1 || faccia == 2)
  50.    {
  51.       _root.nutController.acceso = false;
  52.    }
  53. }
  54.